<template>
<x-main bgColor="#ffffff">
  <view class="x-full-container">
    <view class="x-center">
      <img :src="`${publicPath}/mine/sign_logo.png`">
    </view>

    <view class="big-title">房小租基础服务包介绍</view>

    <view class="slot x-normal-top x-normal-bottom">
      <view class="title">快捷线上收款</view>
      <view class="desc">当您遇到用户未能及时按约定时间付款给您时，您可以发起线上收款服务，由平台协助您收款，大大降低您的收款难度、减少坏账，提高您的经营效率。</view>
    </view>

    <view class="slot x-normal-bottom">
      <view class="title">安全省心</view>
      <view class="desc">您通过线上签约后，收到的款项，自动到您的支付宝账号，安全省心。</view>
    </view>

    <view class="slot x-normal-bottom">
      <view class="title">快捷管理</view>
      <view class="desc">用户订单、账单、费用管理，都在一个小程序里，无需一边手机、一边电脑使用。需要重点关注的账单一目了然，随时随地轻松管理，更有多账号分工管理功能。</view>
    </view>
  </view>

<!--  <view class="other x-normal-bottom">公司支付宝账号开通</view>-->
</x-main>
  <x-bottom>
    <view class="note">以上服务需要开通免密支付服务</view>
    <view @click="onOpen" class="x-btn x-btn-primary">当前支付宝账号开通</view>
  </x-bottom>
</template>

<script setup>
import aliyunStore from '@/stores/modules/aliyun';
import {Helper, Msg} from "core";
const AliyunStore = aliyunStore();
const onOpen = async () => {
  let signStr = await AliyunStore.applySign();
  if(Helper.empty(signStr)) {
    Msg.error("发起授权签名失败");
    return;
  }
  console.log(signStr, 'signStr');
  // #ifdef MP-ALIPAY
  my.paySignCenter({
    signStr: signStr,
    success: async (res) => {
      console.log(res);
    },
    fail: (err) => {
      Msg.error(err.errorMessage);
    }
  })
  // #endif

}
</script>

<style scoped lang="less">
  .big-title {
    color: @primary;
    font-size: 40rpx;
    text-align: center;
  }

  .slot {
    .title {
      color: @primary;
      font-size: 32rpx;
    }

    .desc {
      margin-top: 10rpx;
      font-size: 28rpx;
      color: #999999;
    }
  }

  .other {
    text-align: center;
    font-size: 28rpx;
    color: @primary;
  }

  .note {
    color: #999999;
    font-size: 24rpx;
    text-align: center;
    padding-bottom: 10rpx;
  }
</style>
